home *** CD-ROM | disk | FTP | other *** search
- #!/usr/sbin/perl
-
- # This is a small script to echo the contents of the
- # SoftWindows 2.0 Registration Form so that users can print the information
-
- require "lib.pl";
-
- MAIN:
- {
- # Read in all the variables set by the form
- &ReadParse(*input);
-
- # Print the header
- print &PrintHeader;
- if ($input{'name'} eq "" || $input{'phone'} eq "" ||
- $input{'email_addr'} eq "") {
- print <<INSUFFICIENT_INFO;
- <title>Insufficient Information</title>
- <p>Sorry, to register, we at least need your name, email and phone.
- <p><a href="../reg_card1.html">Re-Register</a>
- INSUFFICIENT_INFO
- exit;
- }
-
- print "<html><head>\n";
- print "<title>SoftWindows 2.0 Warranty Registration Card</title>\n";
- print "</head>\n<body>\n";
-
- $hostname = `/usr/bsd/hostname` ;
- $hostidstring = `/usr/lib/SoftWindows2/FLEXlm/lmhostid`;
- ($junk1, $hostid, $junk2) = split(/"/,$hostidstring) ;
- open(DATA, "/sbin/hinv |") || &CantGetInfo ;
-
- # Do some processing, and print some output
- ($text = $input{'text'}) =~ s/\n/\n<BR>/g;
- # add <BR>'s after carriage returns
- # to multline input, since HTML does not
- # preserve line breaks
- print <<ENDOFTEXT;
-
- <center>
- <H1>Warranty Registration Card</H1>
- <hr size=3 width=50% noshade>
- <h3> User Information </h3>
- <hr size=3 width=50% noshade>
- <table>
- <tr>
- <th align=right>
- Name
- </th>
- <td>
- $input{'name'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Company
- </th>
- <td>
- $input{'company'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Street Address
- </th>
- <td>
- $input{'str_addr'}
- </td>
- </tr>
- <tr>
- <th align=right>
- City
- </th>
- <td>
- $input{'city'}
- </td>
- </tr>
- <tr>
- <th align=right>
- State
- </th>
- <td>
- $input{'state'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Zip
- </th>
- <td>
- $input{'zip'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Country
- </th>
- <td>
- $input{'country'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Phone
- </th>
- <td>
- $input{'phone'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Fax
- </th>
- <td>
- $input{'fax'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Email Address
- </th>
- <td>
- $input{'email_addr'}
- </td>
- </tr>
- </table>
- <p>
- <hr size=3 width=50% noshade>
- <h3> System Information </h3>
- <hr size=3 width=50% noshade>
- <table>
- <tr>
- <th align=right>
- Server host ID or workstation host ID
- </th>
- <td>
- $hostid
- </td>
- </tr>
- <tr>
- <th align=right>
- Server name or workstation name
- </th>
- <td>
- $hostname
- </td>
- </tr>
- <tr>
- <th align=right>
- Hardware
- </th>
- <td>
- $input{'hardware1'} $input{'hardware2'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Operating System
- </th>
- <td>
- $input{'os1'} $input{'os2'}
- </td>
- </tr>
- <tr>
- <th align=right>
- Network(s)
- </th>
- <td>
- $input{'network1'} $input{'network2'} $input{'network3'} $input{'network4'} $input{'network5'}
- </td>
- </tr>
- </table>
-
- ENDOFTEXT
-
- print <<ENDOFTEXT ;
- <p>
- <hr size=3 width=50% noshade>
- <h3 align=center>
- hinv for $hostname
- </h3>
- <hr size=3 width=50% noshade>
-
- <center>
- <table>
- ENDOFTEXT
-
- while( <DATA> )
- {
- ($name, $value) = split(':', $_, 2) ;
- print <<ENDOFTEXT ;
- <tr>
- <th align=right>
- $name
- </th>
- <td>
- $value
- </td>
- </tr>
- ENDOFTEXT
- }
- # close(DATA) ;
-
- print <<ENDOFTEXT ;
- </table>
-
- <p>
- <hr size=3 width=50% noshade>
- <p>
- Please print and either mail or fax to Insignia Solutions
- <p>
- </center>
- In the Americas, Canada and the Pacific Rim, fax to 415-694-3705.
- In Europe, Scandinavia, the Middle East and Africa, fax to
- +44 131 451 6981. Or mail the information to the appropriate Insignia
- Solutions office:
- <p>
- <b>North America</b>
- <pre>
- Insignia Solutions
- 1300 Charleston Road
- Mountain View, CA 94043
- </pre>
-
- <b>United Kingdom</b>
- <pre>
- Insignia Solutions European Response Centre
- P.O. Box 12359
- Edinburgh EH114GP, UK
- </pre>
-
-
- ENDOFTEXT
-
- # Close the document cleanly.
- print "</body></html>\n";
-
- $h=`/sbin/hinv`;
- $a="mail swin_reg\@esd.sgi.com <<HERE
- Subject: Swin 2.0 registration
-
- Name $input{'name'}
- Company $input{'company'}
- Street Address $input{'str_addr'}
- City $input{'city'}
- State $input{'state'}
- Zip $input{'zip'}
- Country $input{'country'}
- Phone $input{'phone'}
- Fax $input{'fax'}
- Email Address $input{'email_addr'}
- Sys ID $hostid
- Host name $hostname
- Hardware $input{'hardware1'} $input{'hardware2'}
- Operating Sys $input{'os1'} $input{'os2'}
- Network $input{'network1'} $input{'network2'} $input{'network3'} $input{'network4'} $input{'network5'}
-
- $h
-
- HERE";
-
- system($a);
-
- }
-
-